package main

import (
	"algorithms/arrayGenerator"
	"algorithms/selectionSort"
	"algorithms/sortingHelper"
	"fmt"
	"log"
)

func main() {
	arr := []Integer{1, 4, 2, 3, 6, 5}
	arr0 := []int{1, 4, 2, 3, 6, 5}
	arr1 := intArray{1, 4, 2, 3, 6, 5}
	arr2 := []int{1, 4, 2, 3, 6, 5}
	students0 := []student{
		{name: "Alice", score: 98},
		{name: "Bobo", score: 100},
		{name: "Charles", score: 66},
	}
	students1 := students{
		student: []student{
			{name: "Alice", score: 98},
			{name: "Bobo", score: 100},
			{name: "Charles", score: 66},
		},
	}

	selectionSort.Sort(arr)
	selectionSort.Sort1(arr0)
	selectionSort.Sort0(arr1)
	selectionSort.Sort2(arr2)
	selectionSort.Sort(students0)
	selectionSort.Sort0(students1)

	fmt.Println(arr)
	fmt.Println(arr0)
	fmt.Println(arr1)
	fmt.Println(arr2)
	fmt.Printf("%+v \n", students0)
	fmt.Printf("%+v \n", students1)

	// 性能测试
	dataSize := []int{10000, 100000}
	for _, n := range dataSize {
		arr := arrayGenerator.GenerateRandomArray(n, n)
		err := sortingHelper.SortTest("SelectionSort", 1, arr)
		if err != nil {
			log.Println(err)
		}
	}

}
